<?php

namespace app\api\controller;

use app\services\CoinService;
use support\Request;

class TaskController
{
    public function getTask(Request $request)
    {
        try {
            $task = CoinService::getBootTask();

            return ok_rsp('成功', $task);
        } catch (\Exception $e) {
            return err_rsp($e->getMessage());
        }
    }

    public function addTask(Request $request)
    {
        try {
            CoinService::addTask();

            return ok_rsp('成功');
        } catch (\Exception $e) {
            return err_rsp($e->getMessage());
        }
    }
}